function allReadyEdit() {
    if (otype == 'add' || otype == 'copy') {
        var zq = NG.callServer('获取周期主键', {'ny': NG.dateFormat(new Date(), 'YYYYmm')}, 'phid');
        NG.setValue('cycleid0', zq);
    }
    NG.bindMasterExp('title', "{pc}+{cycleid0}+{lb}+'成本'");
    curToolbar.insert(4, {
        text: '查看原始单据',
        itemId: 'btn_ysdj',
        iconCls: 'iconfont iconPageWhiteGet',
        handler: function () {
            NG.alert('功能未实现');
        }
    });
    NG.getItem('lb').on('helpselected', function (record) {
        curToolbar.get('btn_ysdj').setText('查看' + record.name + '源单据');
    });
    NG.setSumToMaster('cbje_sum','amt');
    NG.setSumToMaster('zje_sum','zje');
}

function beforeDeleteRow() {
    return false;
}

function beforeDeleteList() {
    return true;
}

function getSaveDataEdit() {
    if (type == 'Approve') {
        return {funcname: '审核更新事件', paramstr: [{phid: NG._getGrid().getSelectionModel().getSelection()[0].data.phid}]};
    }
}

function getSaveDataList() {
    if (type == 'Approve') {
        return {funcname: '审核更新事件', paramstr: [{phid: NG._getGrid().getSelectionModel().getSelection()[0].data.phid}]};
    }
}
